34. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2023-07-12 04:42:37 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

34.1 Files compared

#LocationFileLast Modified
12023-07-12 04:42:37 +0000
2Porto v4.0.6/Theme Files/Porto Theme/app/code/Mageplaza/LayeredNavigation/Setup/Patch/DataUpgradeAttributeData.php2023-05-05 02:25:46 +0000

34.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged00
Changed00
Inserted194
Removed00

34.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

34.4 Active regular expressions

No regular expressions were active.

34.5 Comparison detail

    1 <?php
    2 /**
    3  * Copyright © Magento, Inc. All rights reserved.
    4  * See COPYING.txt for license details.
    5  */
    6 declare(strict_types=1);
    7 
    8 namespace Mageplaza\LayeredNavigation\Setup\Patch\Data;
    9 
    10 use Magento\Catalog\Model\Category;
    11 use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface;
    12 use Magento\Framework\Setup\ModuleDataSetupInterface;
    13 use Magento\Framework\Setup\Patch\DataPatchInterface;
    14 use Magento\Framework\Setup\Patch\PatchRevertableInterface;
    15 use Magento\Eav\Setup\EavSetupFactory;
    16 use Mageplaza\LayeredNavigation\Model\Category\Attribute\Backend\Attributes;
    17 use Mageplaza\LayeredNavigation\Model\Category\Attribute\Source\Attributes as SourceAttributes;
    18 
    19 /**
    20  * Patch is mechanism, that allows to do atomic upgrade data changes
    21  */
    22 class UpgradeAttributeData implements
    23     DataPatchInterface,
    24     PatchRevertableInterface
    25 {
    26     /**
    27      * @var ModuleDataSetupInterface $moduleDataSetup
    28      */
    29     private $moduleDataSetup;
    30 
    31     /**
    32      * @var EavSetupFactory $eavSetupFactory
    33      */
    34     private $eavSetupFactory;
    35 
    36     /**
    37      * @param ModuleDataSetupInterface $moduleDataSetup
    38      */
    39     public function __construct(
    40         ModuleDataSetupInterface $moduleDataSetup,
    41         EavSetupFactory $eavSetupFactory
    42     ) {
    43         $this->moduleDataSetup = $moduleDataSetup;
    44         $this->eavSetupFactory = $eavSetupFactory;
    45     }
    46 
    47     /**
    48      * Do Upgrade
    49      *
    50      * @return void
    51      */
    52     public function apply()
    53     {
    54         $setup = $this->moduleDataSetup;
    55         $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    56 
    57         $eavSetup->addAttribute(Category::ENTITY, 'mp_ln_hide_attribute_ids', [
    58             'type' => 'text',
    59             'label' => 'Hide Filter Attributes on Layered Navigation',
    60             'input' => 'multiselect',
    61             'source' => SourceAttributes::class,
    62             'backend' => Attributes::class,
    63             'required' => false,
    64             'sort_order' => 100,
    65             'global' => ScopedAttributeInterface::SCOPE_STORE,
    66             'group' => 'Display Settings',
    67         ]);
    68 
    69         $setup->endSetup();
    70     }
    71 
    72     /**
    73      * @inheritdoc
    74      */
    75     public function revert()
    76     {
    77     }
    78 
    79     /**
    80      * @inheritdoc
    81      */
    82     public function getAliases()
    83     {
    84         return [];
    85     }
    86 
    87     /**
    88      * @inheritdoc
    89      */
    90     public static function getDependencies()
    91     {
    92         return [];
    93     }
    94 }